/*
*   Coder : Dzlua
*   Email : 505544956@qq.com
*   Time  : 2017/08/10
*/
#pragma once

#include <spdui/spdui.h>
#include <lua4spdui/SDLuaScript.h>
using namespace DuiLib;

namespace ui {

int main() {
    SDPtr->Init();
    
    SDPtr->SetResourcePath(SDPtr->GetInstancePath() + _T("skin"));

    SDLuaScript* script = new SDLuaScript;
    SDPtr->SetStript(script, true);
    if (script->DoFile(SDPtr->GetInstancePath() + _T("lua/main.lua"))) {
        SDPtr->MessageLoop();
    } else {
        SDTString err = SDPtr->GetError();
        cout << SDConvert::TToA(err) << endl;
        MessageBox(NULL, err.c_str(), _T("lua error"), MB_OK);
    }

    SDPtr->Quit();

    return 0;
}

} //end namespace ui